import {SETTOKEN,SETEXPIRES,SETKEYNO,SETPUBILIC,SETBUSID,SETADMINID,SETSHOPNAME,SETUSERNAME} from './mutation-types'
import { localSet } from '../utils'
const mutations = {// 定义所需的 mutations//改变状态
	[SETTOKEN](state,token){	
		state.access_token = token;
		localSet('access_token',state.access_token)
	},
	[SETEXPIRES](state,expries){
	  state.expires_in = expries;
	  localSet('expires_in',state.expires_in)
	},
	[SETKEYNO](state,payload){
		state.keySerialNo = payload
		localSet('keySerialNo',state.keySerialNo)
	},
	[SETPUBILIC](state,payload){
		state.publicKey = payload
		localSet('publicKey',state.publicKey)
	},
	[SETBUSID](state,payload){
		state.busbaseId = payload
		localSet('busbaseId',state.busbaseId)
	},
	[SETADMINID](state,payload){
		state.adminId = payload
		localSet('adminId',state.adminId)
	},
	[SETSHOPNAME](state,payload){
		state.shopName = payload
		localSet('shopName',state.shopName)
	},
	[SETUSERNAME](state,payload){
		state.userName = payload
		localSet('userName',state.userName)
	  },
}
export default mutations

